﻿    <div class="channelSearch">
        <ul>
            <li>
                <input name="txt_code" id="txt_code" type="text" class="channelSearch_input" value="输入股票代码/名称/简拼"
                    size="" /><input id="hid_t" type="hidden" value="" />
            </li>
            <li>
                <input name="" id="soCode" class="stock_search_bt" type="button" />
            </li>
        </ul>
        <script type='text/javascript' src='http://down3.emstock.com.cn/www/js/jquery.autocomplete.pack.js'></script>
        <script src="http://down3.emstock.com.cn/www/js/StockJS.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="http://down3.emstock.com.cn/www/css/jquery.autocomplete.css" />
        <script type="text/javascript">
            $(document).ready(function () {
                $("#txt_code").autocomplete(EALists, {
                    max: 8,
                    minChars: 0,
                    width: 205,
                    matchContains: true,
                    autoFill: false,
                    formatItem: function (row, i, max) {
                        return row._C + " " + row._N + " " + row._T;
                    },
                    formatMatch: function (row, i, max) {
                        return row._C + " " + row._S + " " + row._N;
                    },
                    formatResult: function (row) {

                        return row._C;
                    }
                }).result(function (event, row, formatted) {
                    $("#hid_t").val(row._F);
                });

                $("#txt_code").focus(function () {
                    if ($("#txt_code").val() == "输入股票代码/名称/简拼")
                        $("#txt_code").val("");
                });
                $("#txt_code").blur(function () {
                    if ($("#txt_code").val() == "")
                        $("#txt_code").val("输入股票代码/名称/简拼");
                });

                $("#txt_code").submit(function () {
                    document.location.href = 'Search.aspx?c=' + $("#txt_code").val() + '&f=' + $("#hid_t").val();
                    return false;
                });
                $("#soCode").click(function () {
                    document.location.href = 'Search.aspx?c=' + $("#txt_code").val() + '&f=' + $("#hid_t").val();
                });
                return false;
            })
        </script>
    </div>